package waitnotify;

public class WaitingThread extends Thread {
	
	private boolean isStopped = false;
	
	public void run() {
		System.out.println(this.getName() + "[우선순위:" 
				+ this.getPriority() + "] 시작!");
		while (!isStopped) {
			System.out.println(this.getName());
//			try {
//				Thread.sleep(1);
//			} catch (InterruptedException e) {
//				e.printStackTrace();
//			}
		}
		System.out.println(this.getName() + "[우선순위:" 
				+ this.getPriority() + "] 종료!");
	}
	
	public void stopThread() {
		isStopped = true;
	}
	
}
